package 进阶.线程.多线程;


//1.创建一个子类继承Thread
public class My_Thread extends Thread {
    //2.重写run方法，设置线程任务（开启线程要干吗？）
    @Override
    public void run(){
        for (int i = 0; i < 50; i++) {
            System.out.println("第" + i + "次");
        }

        String name = getName();
        System.out.println(name);
        /*Thread thread = currentThread();
        System.out.println(thread);*/

        System.out.println(Thread.currentThread().getName());
    }



}
